from django.core.mail import send_mail
from django.conf import settings
from models import MailTo

def mail_notify(message):
    recipient_list = [x.email for x in MailTo.objects.filter(enabled=True)]
    if not recipient_list:
        return
    send_mail('djwatch warning', message, settings.EMAIL_HOST_USER, recipient_list)
